

create procedure Matar @PcName varchar(30)
as
declare @Valor int
if exists (select distinct(hostname) From sysprocesses where hostname = @PcName)
begin
select @Valor = spid From sysprocesses where hostname = @PcName
execute ('kill '+@Valor)
end

matar 'SUPORTE_2'



sp_who2 